﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Web;
//using System.Web.UI;
//using System.Web.UI.WebControls;
//using Touch2Like.DAL;
//using Touch2Like.Model;
//using Touch2Like.SharedLibrary;

//namespace Touch2Like.Web.Customer.Popup
//{
//    public partial class EditPassword : System.Web.UI.Page
//    {
//        protected void Page_Load(object sender, EventArgs e)
//        {
//            if (WebUtility.UserGUID == "0")
//            {
//                return;
//            }

//            if (!IsPostBack)
//            {
//                Touch2Like.DAL.UserDAL user = new Touch2Like.DAL.UserDAL();
//                UserInfo userInfo = user.GetUserByUserGuid(WebUtility.UserGUID);

//                if (userInfo != null)
//                {
//                }
//            }
//        }

//        protected void btn_Submit_Click(object sender, EventArgs e)
//        {
//            UserDAL user = new UserDAL ();
//            UserInfo userInfo = user.GetUserByUserGuid(WebUtility.UserGUID);

//            if (userInfo != null)
//            {
//                if (userInfo.Password != Utility.Encryption.Encrypt(tb_CurrentPassword.Text))
//                {
//                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Password is failed.');</script>");
//                    return;
//                }

//                if (tb_NewPassword.Text.Trim() == "")
//                {
//                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('New password is empty.');</script>");
//                    return;
//                }

//                if (tb_NewPassword.Text != tb_ConfirmPassword.Text)
//                {
//                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Confirm password is failed.');</script>");
//                    return;
//                }

//                userInfo.Password = Utility.Encryption.Encrypt(tb_NewPassword.Text);

//                user.Update(userInfo);
//            }

//            ClientScript.RegisterStartupScript(this.GetType(), "update", "<script>top.document.location.href=top.document.location.href;top.document.location.reload();</script>");
//        }
//    }
//}